package com.cloudxingkong.dianyinke.NewTeacher.Adapter;

import android.content.Context;
import android.content.Intent;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.cloudxingkong.dianyinke.NewTeacher.Ui.SettingsActivity;

import java.util.List;

/**
 * Created by 云星空科技 on 2016/3/16.
 */
public class HomePagerAdapter extends PagerAdapter {
    private List<ImageView> list;
    private Context context;
    public HomePagerAdapter(List<ImageView> list,Context context) {
        this.list = list;
        this.context=context;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view==object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {


        container.addView(list.get(position));
        return list.get(position);
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {

        container.removeView(list.get(position));
    }
}
